package com.atguigu.tingshu.order.service.impl;

import com.atguigu.tingshu.common.constant.SystemConstant;
import com.atguigu.tingshu.order.config.PrivateKeyConfigInt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.jwt.Jwt;
import org.springframework.security.jwt.JwtHelper;
import org.springframework.security.jwt.crypto.sign.RsaVerifier;
import org.springframework.stereotype.Service;

@Service
public class test {
    @Autowired
    private PrivateKeyConfigInt privateKeyConfigInt ;
    public static void main(String[] args) {

        Jwt decoded = JwtHelper.decodeAndVerify("eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJkZXJhdGVBbW91bnQiOjMwLjAwLCJpdGVtVHlwZSI6IjEwMDMiLCJvcmRlckFtb3VudCI6OTAuMDAsIm9yZGVyRGVyYXRlVm9MaXN0IjpbeyJkZXJhdGVBbW91bnQiOjMwLjAwLCJkZXJhdGVUeXBlIjoiVklQ5pyN5Yqh5oqY5omjIiwicmVtYXJrcyI6Iua1i-ivlSJ9XSwib3JkZXJEZXRhaWxWb0xpc3QiOlt7Iml0ZW1JZCI6MywiaXRlbU5hbWUiOiJWaXDotK3kubAx5bm0IiwiaXRlbVByaWNlIjo5MC4wMCwiaXRlbVVybCI6Imh0dHA6Ly8zOS45OC4xMjMuMjExL2dyb3VwMS92aXAucG5nIn1dLCJvcmlnaW5hbEFtb3VudCI6MTIwLjAwLCJwYXlXYXkiOiIxMTAxIiwidGltZXN0YW1wIjoxNzE1NDIyMTMyMzQxLCJ0cmFkZU5vIjoibjgxS2pINk5TN3V6bkhxQ1VfQnpQQSJ9.AQymWxPAPInCXDUUbSD0TExs-Qx4JfdTiZOtKpDwLMECAe8vS6D2QsVEozFDW4ZE7UMWkZ9KrWHPEs5B0A1N7eTwsbKSSaFYv_9o6Jjv6bzrLBf4efv4foT3_s-xN96Et3uw9-fcYWyR43je-f3i4gjii84Kul8YGClZ0bdJGhfuLbr6hfD9QtQKsYvWq3-7hXI-oTiXLdsJow2Zb2Lx2y_Sdo7DMFAypXxSVHdEZjDr9EG3adP5nkY9ZH98Hhpa5Y8ia4m_tyxW1YE2mqYNM2K8f3UguLPsIJ3Mqsxw5gofaJo2oxGcNrZck3VZmEniZvCbDY0iDt0GTpA050zawA", new RsaVerifier(SystemConstant.PUBLIC_KEY));
        System.out.println(decoded);
    }
}
